<?php

namespace fastflow\driver\think;

use think\Db;
use fastflow\driver\interfaces\threadTemplate;

class thread implements threadTemplate
{
    
    public static function getThread($param)
    {
        if (isset($param)) {
            $threads = Db::table('__FASTFLOW_THREAD__')->where($param)->select();
            if (count($threads) == 0) {
                return false;
            }
            return $threads;
        }
        return false;
    }

    
    public static function setThread($param)
    {
        if (isset($param)) {
            $count = Db::table('__FASTFLOW_THREAD__')->update($param);
            return $count;
        }
        return false;
    }

    
    public static function addThread($param)
    {
        if (isset($param)) {
            $id = Db::table('__FASTFLOW_THREAD__')->insertGetId($param);
            return $id;
        }
        return false;
    }
}